<?php /*a:2:{s:67:"D:\laragon\www\ssbeautiful\application\manage\view\index_index.html";i:1567153186;s:60:"D:\laragon\www\ssbeautiful\application\manage\view\base.html";i:1596192950;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<div class="g-index">
    <div class="m-index-header">
        <div class="m-container-fluid clearfix">
            <h1><?php echo htmlentities($site_info['site_name']); ?></h1>
            <ul class="m-main-nav fl">
                <?php if(is_array($menus) || $menus instanceof \think\Collection || $menus instanceof \think\Paginator): if( count($menus)==0 ) : echo "" ;else: foreach($menus as $key=>$menu): ?>
                <li class="<?php if($menu['id'] != 2): ?>m-nav-menu<?php else: ?>m-drop-down<?php endif; if($key == 0): ?> item-act<?php endif; ?>"><a href="javascript:;"><?php echo htmlentities($menu['name']); if($menu['id'] == 2): ?><i class="icon-angle-down"></i><?php endif; ?></a>
                    <?php if($menu['id'] == 2): ?>
                    <ul class="m-child">
                        <?php if(is_array($menu['child']) || $menu['child'] instanceof \think\Collection || $menu['child'] instanceof \think\Paginator): if( count($menu['child'])==0 ) : echo "" ;else: foreach($menu['child'] as $k=>$second): ?>
                        <li class="m-nav-menu<?php if(count($menu['child']) == ($k - 1)): ?> m-last<?php endif; ?>"><a href="javascript:;"><?php echo htmlentities($second['name']); ?></a></li>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul>
                    <?php endif; ?>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </ul>
            <ul class="m-side-nav fr">
                <li><p>您好，管理员 <?php echo session('username', '', session_prefix()); ?></p></li>
                <li><a href="/manage" title="网站首页" target="_blank"><i class="icon-home"></i></a></li>
				<li><a href="javascript:;" title="修改密码" id="j_edit" ><i class="icon-edit"></i>修改密码</a></li>
                <li><a href="javascript:;" title="退出登录" id="j_quit"><i class="icon-signout"></i>退出</a></li>
            </ul>
        </div>
    </div>
    <div class="m-index-aside">
        <?php if(is_array($menus) || $menus instanceof \think\Collection || $menus instanceof \think\Paginator): if( count($menus)==0 ) : echo "" ;else: foreach($menus as $key=>$menu): if($menu['id'] == 2): if(is_array($menu['child']) || $menu['child'] instanceof \think\Collection || $menu['child'] instanceof \think\Paginator): if( count($menu['child'])==0 ) : echo "" ;else: foreach($menu['child'] as $key=>$second): ?>
        <div class="m-aside-nav<?php if($key == 0): ?> dn<?php endif; ?>">
            <?php if($second['child']): if(is_array($second['child']) || $second['child'] instanceof \think\Collection || $second['child'] instanceof \think\Paginator): if( count($second['child'])==0 ) : echo "" ;else: foreach($second['child'] as $key=>$third): ?>
            <dl>
                <dt><i class="icon <?php echo !empty($third['icon']) ? htmlentities($third['icon']) : 'icon-circle-blank'; ?>"></i><?php echo htmlentities($third['name']); ?><i class="icon-angle icon-angle-down"></i></dt>
                <dd>
                    <ul>
                        <?php if(is_array($third['child']) || $third['child'] instanceof \think\Collection || $third['child'] instanceof \think\Paginator): if( count($third['child'])==0 ) : echo "" ;else: foreach($third['child'] as $key=>$four): ?>
                        <li><a href="<?php echo htmlentities($four['url']); ?>" target="main"><?php echo htmlentities($four['name']); ?></a></li>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul>
                </dd>
            </dl>
            <?php endforeach; endif; else: echo "" ;endif; else: ?>
            <div class="m-column-trees">
                <?php if($trees): ?>
                <ul class="columns-tree"><?php echo html_entity_decode($trees); ?></ul>
                <?php else: ?>
                <p>暂无相关栏目</p>
                <?php endif; ?>
            </div>
            <?php endif; ?>
        </div>
        <?php endforeach; endif; else: echo "" ;endif; else: ?>
        <div class="m-aside-nav<?php if($key == 0): ?> dn<?php endif; ?>">
            <?php if($menu['child']): if(is_array($menu['child']) || $menu['child'] instanceof \think\Collection || $menu['child'] instanceof \think\Paginator): if( count($menu['child'])==0 ) : echo "" ;else: foreach($menu['child'] as $key=>$second): ?>
            <dl>
                <dt><i class="icon <?php echo !empty($second['icon']) ? htmlentities($second['icon']) : 'icon-circle-blank'; ?>"></i><?php echo htmlentities($second['name']); ?><i class="icon-angle icon-angle-down"></i></dt>
                <dd>
                    <ul>
                        <?php if(is_array($second['child']) || $second['child'] instanceof \think\Collection || $second['child'] instanceof \think\Paginator): if( count($second['child'])==0 ) : echo "" ;else: foreach($second['child'] as $key=>$third): ?>
                        <li><a href="<?php echo htmlentities($third['url']); ?>" target="main"><?php echo htmlentities($third['name']); ?></a></li>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul>
                </dd>
            </dl>
            <?php endforeach; endif; else: echo "" ;endif; else: ?>
            <dl><?php echo htmlentities($menu['name']); ?></dl>
            <?php endif; ?>
        </div>
        <?php endif; endforeach; endif; else: echo "" ;endif; ?>
    </div>
    <div class="m-animate-aside"><a href="javascript:;" class="animate-btn" onclick="animate_aside(this)"></a></div>
    <div class="m-index-main"><iframe src="<?php echo url('welcome'); ?>" name="main" id="main_frame" scrolling="yes" frameborder="0"></iframe></div>
</div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

<script>
    $(function(){
        layui.use('layer', function(){
            $('#j_quit').on('click', function(){
                layer.open({
                    title: '提示信息',
                    btn: ['确定', '取消'],
                    content: '您确定要退出登录吗？',
                    icon: 3,
                    yes: function(index){
                        // 确定
                        $.post('/quit', {}, function(ret){
                            if (ret.status == 0) {
                                layer.close(index);
                                window.location.href = '/manage';
                            }
                        }, 'json');
                    },
                    btn2: function(index){
                        // 取消
                    }
                });
            });
        });
        
        $('.m-drop-down').hover(function(){
            $(this).find('ul').show();
        }, function(){
            $(this).find('ul').hide();
        });
        
        $('.m-aside-nav dd li').click(function(){
            $('.m-aside-nav dd li').removeClass('m-item-act');
            $(this).addClass('m-item-act');
        });
        
        $('.u-cate').click(function(){
            var $ul = $(this).parent().find('ul:eq(0)');
            if ($ul.is(':hidden')) {
                $(this).find('.icon-tree-control').removeClass('ico-tree-plus').addClass('ico-tree-minus');
                $(this).find('.ico-folder').removeClass('ico-tree-folder-close').addClass('ico-tree-folder-open');
                $ul.slideDown(150);
            } else {
                $(this).find('.icon-tree-control').removeClass('ico-tree-minus').addClass('ico-tree-plus');
                $(this).find('.ico-folder').removeClass('ico-tree-folder-open').addClass('ico-tree-folder-close');
                $ul.slideUp(150);
            }
        });
        $('#j_edit').on('click',function(){

            var edit_html="<div class=\"layui-form\" lay-filter=\"layuiadmin-form-useradmin\" id=\"layuiadmin-form-useradmin\" style=\"padding: 20px 0 0 0;\">\n" +


                "    <div class=\"layui-form-item\">\n" +


                "      <label class=\"layui-form-label\">旧密码</label>\n" +


                "      <div class=\"layui-input-inline\">\n" +


                "        <input type=\"password\" name=\"old_pass\" lay-verify=\"required\" placeholder=\"请输入旧密码\" autocomplete=\"off\" class=\"layui-input\">\n" +


                "      </div>\n" +


                "    </div>\n" +


                "    <div class=\"layui-form-item\">\n" +


                "      <label class=\"layui-form-label\">新密码</label>\n" +


                "      <div class=\"layui-input-inline\">\n" +


                "        <input type=\"password\" name=\"new_pass\" lay-verify=\"required\" placeholder=\"请输新密码\" autocomplete=\"off\" class=\"layui-input\">\n" +


                "      </div>\n" +


                "    </div>\n" +


                "    <div class=\"layui-form-item\">\n" +


                "      <label class=\"layui-form-label\">确认密码</label>\n" +


                "      <div class=\"layui-input-inline\">\n" +


                "        <input type=\"password\" name=\"confirm_pass\" lay-verify=\"required\" placeholder=\"请输确认密码\" autocomplete=\"off\" class=\"layui-input\">\n" +


                "      </div>\n" +


                "    </div>\n" +


                "  </div>\n" +


                "<div class=\"layui-layer-btn layui-layer-btn-\" style=\"text-align: center;\">  <button id=\"j_edit_pass\" class=\"u-btn\">确定提交</button></div></div>" +


                "<span class=\"layui-layer-setwin\"><a class=\"layui-layer-ico layui-layer-close layui-layer-close1\" href=\"javascript:;\"></a></span>";


            layer.open({


                type: 1,


                title:'修改密码',


                shadeClose: true, //点击遮罩关闭


                area: ['400px', '350px'], //宽高


                content: edit_html


            });


        })



        //修改密码


        $("body").on("click","#j_edit_pass",function(){


            var old_pass=$("input[name='old_pass']").val();


            var new_pass=$("input[name='new_pass']").val();


            var confirm_pass=$("input[name='confirm_pass']").val();


            if(old_pass==='' || old_pass===null || old_pass===undefined){

                layer.msg('请输入旧密码不能空！');

                return false;

            }

            if(new_pass==='' || new_pass===null || new_pass===undefined){

                layer.msg('请输入新密码不能空！');

                return false;

            }

            if(confirm_pass==='' || confirm_pass===null || confirm_pass===undefined){

                layer.msg('请输入确认密码不能空！');

                return false;

            }

            if(new_pass !==confirm_pass){

                layer.msg('新密码与确认不相同！');

                return false;

            }

            $.post('/manage/users/editpass',{

                old_pass:old_pass,

                password:new_pass,

                password_confirm:confirm_pass

            },function(res){

                console.log(res)

                if(res.code===1){

                    layer.msg(res.msg);

                    setTimeout(function(){


                        layer.closeAll();


                        $.post('/quit', {}, function(ret){


                            console.log(ret)


                            if (ret.status == 0) {


                                window.location.href = '/manage';


                            }


                        }, 'json');


                    },1000)


                }else{


                    layer.msg(res.msg);


                }


            })


        });
    });
    
    function jsSwitch(ele, divId, divName, divCount)
    {
        for (var i = 0; i < divCount; i++) {
            $('#' + divName + i).hide();
        }
        $('.m-main-nav li').removeClass('item-act');
        $(ele).parent().addClass('item-act');
        $('#' + divName + divId).show();
    }
</script>

</body>
</html>